/**
 * All rights Reserved, Designed By www.shatayy.com
 * @Title:  ${file_name}
 * @Package ${package_name}
 * @Description:    ${todo}(用一句话描述该文件做什么)
 * @author: 宁波沙塔信息技术有限公司
 * @date:   ${date} ${time}
 * @version V1.0
 * @Copyright: ${year} www.tydic.com Inc. All rights reserved.
 * 注意：本内容仅限于宁波沙塔信息技术股份有限公司内部传阅，禁止外泄以及用于其他的商业目
 */
package com.nbst.comnutil;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * @ClassName: NormalResult
 * @Description:
 * @author 兵
 * @date 2017-6-16
 *
 */

public class NormalResult implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private String code; // 返回码

	private String message; // 返回消息

	private Object dataset; // 返回结果集

	private Object obj; //返回结果集

	private String id; // 返回新增的数据ID

	private Object rows;// 返回结果集

	private long total;// 数据量总数

	private String type;// 类型

	private String desc;//操作描述

	private String billNo;//单据编号

	public NormalResult(String code, String message) {
		this.code = code;
		this.message = message;
		this.setRows(new ArrayList<>());
		this.setDataset(new ArrayList<>());
		this.setTotal(0);
	}

	public NormalResult() {
		this.code = Constants.DefaultResultEnums.SERVICE_ERROR.getCode();
		this.message = Constants.DefaultResultEnums.SERVICE_ERROR.getName();
		this.setRows(new ArrayList<>());
		this.setTotal(0);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}

	public String getBillNo() {
		return billNo;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getDataset() {
		return dataset;
	}

	public void setDataset(Object dataset) {
		this.dataset = dataset;
	}

	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Object getRows() {
		return rows;
	}

	public void setRows(Object rows) {
		if (rows != null) {
			this.rows = rows;
		}
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	@Override
	public String toString() {
		return "NormalResult{" +
				"code='" + code + '\'' +
				", message='" + message + '\'' +
				", dataset=" + dataset +
				", id='" + id + '\'' +
				", rows=" + rows +
				", total=" + total +
				", type='" + type + '\'' +
				", desc='" + desc + '\'' +
				'}';
	}
}